<template>
	<view class="box text-center">
		<view class="e-flex-xy-center e-m-b-38">
			<app-image :size="['320rpx','224rpx']" src="user/success.png"
				/>
		</view>
		<view class="e-m-b-30">
			{{$t(`order.${statusList[orderType].title}`)}}
		</view>
		<view class="e-m-b-40">
			{{$t(`order.${statusList[orderType].sub}`)}}
		</view>
		<view class="e-flex">
			<button class="e-m-r-20" @tap="backHome" v-if="orderType == 1">{{$t('yuncang.返回云仓商城')}}</button>
			<button @tap="see">{{$t(`order.${statusList[orderType].buttonText}`)}}</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusList:{
					0:// cancel
					{
						title:'订单取消成功',
						sub:'订单已取消',
						buttonText:'其他订单'
					},
					// success
					4:{
						title:'支付成功',
						sub:'恭喜您支付成功',
						buttonText:'订单列表'
					}
				},
				id:null,
				orderType:0
			};
		},
		onLoad(opt) {
			this.orderType = opt?.type||0,
			this.id = opt.id
		},
		methods:{
			backHome () {
				this.$switchTab('/pages/yuncang/index')
			},
			see () {
				uni.redirectTo({
					url:'/pages/yuncang/order/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		padding-top: 158rpx;
		margin: 0 auto;
		button{
			width: 278rpx;
			height: 90rpx;
			line-height: 90rpx;
			border-radius: 45rpx;
			border: 2rpx solid #303133;
			font-size: 30rpx;
		}
	}

</style>
